{extend name='layout'}
{block name='body'}
{Ke:seturl name='create,edit,delete,money,integral'}
{Ke:seturl name='attachment' link='@attachment' ext=''}
<div class="row">
	<div class="title">附件管理</div>
</div>
<div class="margin-li">

  <!-- 筛选框 start -->
  <el-form :inline="true" :model="search" size="mini">


    <el-form-item label="关键词">
      <el-input v-model="search.key" @keyup.enter.native="onSearch" placeholder="ID/文件名"></el-input>
    </el-form-item>

    <el-form-item label="状态">
      <el-select v-model="search.status" style="width:80px">
        <el-option :value="-1" label="全部"></el-option>
        <el-option :value="1" label="在用"></el-option>
        <el-option :value="0" label="未用"></el-option>
      </el-select>
    </el-form-item>

    <el-form-item label="上传时间">
      <el-date-picker
        v-model="search.date"
        type="daterange"
        align="right"
        unlink-panels
        range-separator="至"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        value-format="yyyy-MM-dd">
      </el-date-picker>
    </el-form-item>

    <el-form-item>
      <el-button type="primary" @click="onSearch">筛选</el-button>
    </el-form-item>
  </el-form>
  <!-- 筛选框 end -->


  <el-table
    v-loading="loadList"
    :data="list"
    border
    stripe>
      <el-table-column prop="id" label="FID">
  	</el-table-column>
    <el-table-column label="文件名">
      <template slot-scope="item">
        {{ item.row.names }}

        <el-popover
          placement="right"
          trigger="click"
          :content="map.attachment + '?id=' + item.row.id">
          <el-button type="text" slot="reference">查看地址</el-button>
        </el-popover>


        <el-popover
          placement="right"
          trigger="click"
          :content="item.row.src">
          <el-button type="text" slot="reference">保存位置</el-button>
        </el-popover>
        
      </template>
    	</el-table-column>
    <el-table-column prop="mime" label="MIME" width="160" align="center">
      </el-table-column>
    <el-table-column prop="uploadDate" label="上传时间" width="120" align="center">
      </el-table-column>
    <el-table-column prop="statusText" label="状态" width="80" align="center">
      </el-table-column>
    <el-table-column label="操作" width="80">
        <template slot-scope="scope">
          <el-dropdown trigger="click" @command="onUserAction">
            <span class="el-dropdown-link">
              操作<i class="el-icon-arrow-down el-icon--right"></i>
            </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item :command="{ type: 'move', item:scope.row }">移到云存储</el-dropdown-item>
              <el-dropdown-item :command="{ type: 'delete', item:scope.row }">删除</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </template>
      </el-table-column>

  </el-table>




  <!-- 分页 start -->
  <div class="block">
    <el-pagination
      layout="sizes, total, prev, pager, next, jumper"
      :page-sizes="[10, 20, 50, 100]"
      :page-size="size"
      :total="total"
      @size-change="tabSize"
      @current-change="loadLists">
    </el-pagination>
  </div>
  <!-- 分页 end -->
</div>

<!-- 充值窗口 start -->
<el-dialog :title="dialog.title" :visible.sync="dialog.status"
    :close-on-click-modal="false"
    width="400px"
    @close="onDialogResetFields"
    @before-close="onDialogResetFields">
  <el-form :model="dialog.form" :rules="dialog.rules" ref="dialogForm">
    <el-form-item :label="dialog.label" prop="value" label-width="60px">
      <el-input v-model="dialog.form.value" auto-complete="off"></el-input>
    </el-form-item>
  </el-form>
  <div slot="footer" class="dialog-footer">
    <el-button @click="onDialogSubmit(0)">取 消</el-button>
    <el-button type="primary" @click="onDialogSubmit(1)">确 定</el-button>
  </div>
</el-dialog>
<!-- 充值窗口 end -->
{/block}